table = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
list = []


def expand(s1):
    zimu = s1.split("-")
    for i in range(len(zimu) - 1, -1, -1):
        if table.index(zimu[i]) - table.index(zimu[0]) > 0:
            mid = i
            break
    for i in table[table.index(zimu[0]):table.index(zimu[mid])]:
        list.append(i)
    for i in zimu[mid:-1:]:
        list.append(i)
        list.append("-")
    list.append(zimu[len(zimu) - 1])
    list.append(" ")


arrs = input().split(" ")
for i in arrs:
    expand(i)
for i in list:
    print(i, end="")
